<template>
	<view class="page">
		<view class="block_1">

			<view class="group_2">
				<image style="width: 710rpx;height: 340rpx;border-radius: 12rpx;" :src="splist.img" mode="aspectFill"></image>
			</view>
			<view class="group_3">
				<view class="group_4">
					<view class="text-wrapper_1">
						<text lines="1" class="text_3">{{splist.name}}</text>
						<text lines="1" class="text_4">{{splist.buy}}人预约</text>
					</view>
					<view class="block_4">
						<view class="section_1">
							<view class="text-wrapper_2">
								<text lines="1" class="text_5">{{splist.open}}</text>
								<text lines="1" class="text_6">{{splist.open_time}}</text>
							</view>
							<view class="image-text_1">
								<image :src="po57" class="label_4"></image>
								<text lines="1" class="text-group_1">{{splist.pos}}</text>
							</view>
						</view>
						<!-- <view class="text-wrapper_3" @click="onsport">
							预定
						</view> -->
					</view>
					<view class="block_5">
						<view class="text-group_2">
							<text lines="1" class="text_8">场地简介</text>
							<scroll-view scroll-y lines="1" class="text_9">
								<u-parse :content="splist.description"></u-parse>
							</scroll-view>
						</view>
					</view>
				</view>
				<view class="group_5">
					<view class="image-text_2">
						<view class="group_6"></view>
						<view class="text-group_3">设施服务</view>
					</view>
				</view>


				<view class="group_7" v-for="(item,index) in splist.marks" marks>
					<view class="image-text_3">
						<image :src="item.key.icon" class="label_5"></image>
						<view class="text-group_4">
							<view class="text_10">{{item.key.name}}</view>
						</view>
					</view>
					<view class="image-text_4" >
						<view class="text_11"  v-for="(im,inx) in item.value" :key="inx" :class="im.length == 0 ? 'text_123':''">{{im}}</view>
						<!-- <view class="text_3-1"></view> -->
						<!-- <view class="text_12">有卫生间</view> -->
						<!-- <view class="text_3-1"></view> -->
						<!-- <view class="text_13">无烟环境</view> -->
					</view>
				</view>
				<!-- 
				<view class="group_7">
					<view class="image-text_3">
						<image :src="po58" class="label_5"></image>
						<view class="text-group_4">
							<text lines="1" class="text_10">特色服务</text>
						</view>
					</view>
					<view class="image-text_4">
						<view class="text_11">器材租赁</view>
					</view>
				</view>

				<view class="group_7">
					<view class="image-text_3">
						<image :src="po56" class="label_5"></image>
						<view class="text-group_4">
							<text lines="1" class="text_10">电子设备</text>
						</view>
					</view>
					<view class="image-text_4">
						<view class="text_11">免费WIFI</view>
						<view class="text_3-1"></view>
						<view class="text_12">有充电宝</view>
					</view>
				</view>
				<view class="group_7">
					<view class="image-text_3">
						<image :src="po59" class="label_5"></image>
						<view class="text-group_4">
							<text lines="1" class="text_10">停车</text>
						</view>
					</view>
					<view class="image-text_4">
						<view class="text_11">免费停车</view>
					</view>
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	const subscribe = require('@/api/subscribe/index.js');
	export default {
		data() {
			return {
				po50: this.$https.assetsPath + 'po50.png',
				po57: this.$https.assetsPath + 'po57.png',
				po63: this.$https.assetsPath + 'po63.png',
				po58: this.$https.assetsPath + 'po58.png',
				po56: this.$https.assetsPath + 'po56.png',
				po59: this.$https.assetsPath + 'po59.png',
				foodid:'',
				splist:{},
				time_list:''
			};
		},
		onLoad(options) {
			this.foodid = options.foodid
			this.getSportsCourtInfo()
		},
		onShow() {

		},
		methods: {
			onsport(){
				var _this = this
				var now = new Date()
				var h = now.getHours(); //获取当前小时数(0-23)
				var min = now.getMinutes(); //获取当前分钟数(0-59)
				if (h < 10) {
					h = '0' + h
				}
				if (min < 10) {
					min = '0' + min
				}
				this.time_list = h + ':' + min
				let open_time_end = this.splist.open_time_end
				let open_time_start = this.splist.open_time_start
				if (this.time_list > open_time_start && this.time_list < open_time_end) {
					if (uni.getStorageSync("openid") == '' || uni.getStorageSync("openid") == null) {
						uni.showToast({
							title: '请登录！',
							icon: 'none',
							duration: 850
						});
						// setTimeout(() => {
						// 	uni.reLaunch({
						// 		url: '/pages/personal/personal'
						// 	})
						// }, 1000)
					} else {
						uni.navigateTo({
							url: '/page_venues/pages/venuesDetail/stadium/stadium?id=' + this.splist.id +
								"&court_id=" +
								this.splist.id +
								"&name=" +
								this.splist.name +
								'&venue_id=' +
								this.splist.venue_id +
								'&windows=' +
								this.splist.windows
						})
					}
				
				}
				
			},
			// 获取分类商品
			async getSportsCourtInfo() {
				let data = {
					id:this.foodid
				}
				let result = await subscribe.getSportsCourtInfo(data)
				if (result.code == 1) {
					this.splist = result.data
					this.splist.marks[1].value.forEach((item, index) => {
					})
				}
			},
			
		}
	};
</script>

<style lang="scss" scoped>
	.page {
		background-color: rgba(237, 245, 245, 1.0);
		position: relative;
		width: 750rpx;
		height: 100%;
		overflow: hidden;
		display: flex;
		flex-direction: column;
	}

	.block_1 {
		background-color: rgba(255, 255, 255, 1.0);
		height: 100%;
		display: flex;
		flex-direction: column;
	}


	.group_2 {
		width: 710rpx;
		height: 340rpx;
		align-self: center;
		display: flex;
		flex-direction: column;
	}

	.group_3 {
		display: flex;
		flex-direction: column;
		padding: 30rpx 20rpx 0 20rpx;
	}

	.group_4 {
		background-color: rgba(255, 255, 255, 1.0);
		border-radius: 12rpx;
		height: 510rpx;
		display: flex;
		flex-direction: column;
	}

	.text-wrapper_1 {
		width: 710rpx;
		flex-direction: row;
		display: flex;
		justify-content: space-between;
	}

	.text_3 {
		overflow-wrap: break-word;
		color: rgba(51, 51, 51, 1);
		font-size: 40rpx;
		font-family: PingFangSC-Medium;
		font-weight: 500;
		text-align: left;
		white-space: nowrap;
		line-height: 56rpx;
	}

	.text_4 {
		overflow-wrap: break-word;
		color: rgba(166, 166, 166, 1);
		font-size: 24rpx;
		font-family: PingFangSC-Regular;
		font-weight: normal;
		text-align: left;
		white-space: nowrap;
		line-height: 22rpx;
		margin-top: 17rpx;
	}

	.block_4 {
		width: 710rpx;
		margin-top: 10rpx;
		flex-direction: row;
		display: flex;
		justify-content: space-between;
	}

	.section_1 {
		display: flex;
		flex-direction: column;
	}

	.text-wrapper_2 {
		width: 400rpx;
		flex-direction: row;
		display: flex;
		justify-content: flex-start;
	}

	.text_5 {
		overflow-wrap: break-word;
		color: rgba(75, 166, 119, 1.0);
		font-size: 26rpx;
		font-family: PingFangSC-Regular;
		font-weight: normal;
		text-align: left;
		white-space: nowrap;
		line-height: 22rpx;
	}

	.text_6 {
		overflow-wrap: break-word;
		color: rgba(102, 102, 102, 1);
		font-size: 26rpx;
		font-family: PingFangSC-Regular;
		font-weight: normal;
		text-align: left;
		white-space: nowrap;
		line-height: 22rpx;
		margin-left: 15rpx;
	}

	.image-text_1 {
		width: 138rpx;
		flex-direction: row;
		display: flex;
		justify-content: flex-start;
		align-items: center;
		margin-top: 15rpx;
	}

	.label_4 {
		width: 24rpx;
		height: 24rpx;
	}

	.text-group_1 {
		overflow-wrap: break-word;
		color: rgba(102, 102, 102, 1);
		font-size: 26rpx;
		font-family: PingFangSC-Regular;
		font-weight: normal;
		text-align: left;
		white-space: nowrap;
		line-height: 22rpx;
		margin-left: 15rpx;
	}

	.text-wrapper_3 {
		background: linear-gradient(135deg, #6BD3A6 0%, #56BF89 100%), #56BF89;
		border-radius: 10rpx;
		width: 120rpx;
		height: 50rpx;
		display: flex;
		flex-direction: column;
		font-weight: 400;
		font-size: 26rpx;
		color: #FFFFFF;
		line-height: 50rpx;
		text-align: center;
	}

	.block_5 {
		background-color: #f4f9f9;
		border-radius: 4rpx;
		margin-top: 19rpx;
		display: flex;
		flex-direction: row;
		padding: 20rpx 20rpx 0 20rpx;
		height: 400rpx;
		width: 100%;
	}

	.text-group_2 {
		display: flex;
		flex-direction: column;
		height: 400rpx;
		width: 100%;
	}

	.text_8 {
		overflow-wrap: break-word;
		color: rgba(51, 51, 51, 1);
		font-size: 28rpx;
		font-family: PingFangSC-Medium;
		font-weight: 700;
		text-align: left;
		white-space: nowrap;
		line-height: 40rpx;
		margin-right: 558rpx;
	}

	.text_9 {
		width: 670rpx;
		height: 290rpx;
		overflow-wrap: break-word;
		color: rgba(102, 102, 102, 1);
		font-size: 26rpx;
		font-family: PingFangSC-Regular;
		font-weight: normal;
		text-align: justify;
		line-height: 40rpx;
		margin-top: 9rpx;
	}

	.group_5 {
		background-color: rgba(255, 255, 255, 1.0);
		border-radius: 12rpx;
		margin-top: 10rpx;
		display: flex;
		flex-direction: row;
		padding: 20rpx 0 0 0;
	}

	.image-text_2 {
		width: 128rpx;
		flex-direction: row;
		display: flex;
		justify-content: flex-start;
	}

	.group_6 {
		background-color: rgba(75, 166, 119, 1.0);
		border-radius: 12rpx;
		width: 6rpx;
		height: 24rpx;
		display: flex;
		flex-direction: column;
		margin: 8rpx 0 8rpx 0;
	}

	.text-group_3 {
		overflow-wrap: break-word;
		color: rgba(51, 51, 51, 1);
		font-size: 28rpx;
		font-family: PingFangSC-Medium;
		font-weight: 700;
		text-align: left;
		white-space: nowrap;
		line-height: 40rpx;
		margin-left: 10rpx;
	}

	.group_7 {
		flex-direction: column;
		display: flex;
		margin: 25rpx 0 0 0;
	}

	.image-text_3 {
		width: 146rpx;
		flex-direction: row;
		display: flex;
		// justify-content: space-between;
	}

	.image-text_4 {
		display: flex;
		flex-direction: row;
		// justify-content: center;
		align-items: center;
		// justify-content: space-around;
		justify-content: flex-start;
		margin-top: 20rpx;
		flex-wrap: wrap;
	}

	.label_5 {
		width: 28rpx;
		height: 28rpx;
	}

	.text-group_4 {
		margin-top: 3rpx;
		display: flex;
		flex-direction: column;
	}

	.text_10 {
		overflow-wrap: break-word;
		color: rgba(51, 51, 51, 1);
		font-size: 26rpx;
		font-family: PingFangSC-Regular;
		font-weight: normal;
		text-align: left;
		white-space: nowrap;
		line-height: 22rpx;
		margin-left: 10rpx;
	}

	.text_11 {
		overflow-wrap: break-word;
		color: rgba(102, 102, 102, 1);
		font-size: 26rpx;
		text-align: center;
		line-height: 40rpx;
		// margin-left: 14%;
		width: 33.3%;
		height: 25rpx;
		border-right: #dcdcdc 1rpx solid;
		margin: 20rpx 0;
		line-height: 25rpx;
	}
	
	.text_11 {
	    width: 33.3%;
	    height: 25rpx;
	    border-right: #dcdcdc 1rpx solid;
	    margin: 20rpx 0;
	    line-height: 25rpx;
	    text-align: center;
	    font-size: 26rpx;
	    color: #666666;
	    overflow-wrap: break-word;
	}
	
	.text_11:last-child {
	    border-right: none; /* 最后一个元素去掉右侧边框 */
	}
	
	.text_123 {
		overflow-wrap: break-word;
		color: rgba(102, 102, 102, 1);
		font-size: 26rpx;
		text-align: center;
		line-height: 40rpx;
		// margin-left: 14%;
		width: 33.3%;
		height: 25rpx;
		// background-color: #56BF89;
		margin: 20rpx 0;
		line-height: 25rpx;
	}
	
	
	.image_2 {
		width: 1rpx;
		height: 25rpx;
		margin: 46rpx 0 8rpx 64rpx;
	}

	.text_12 {
		overflow-wrap: break-word;
		color: rgba(102, 102, 102, 1);
		font-size: 26rpx;
		font-family: PingFangSC-Regular;
		font-weight: normal;
		text-align: left;
		white-space: nowrap;
		line-height: 40rpx;
	}

	.text_3-1 {
		background-color: #7C9789;
		border-radius: 12rpx;
		width: 1rpx;
		height: 25rpx;
		display: flex;
		flex-direction: row;
	}

	.image_3 {
		width: 1rpx;
		height: 25rpx;
		margin: 46rpx 0 8rpx 64rpx;
	}

	.text_13 {
		overflow-wrap: break-word;
		color: rgba(102, 102, 102, 1);
		font-size: 26rpx;
		font-family: PingFangSC-Regular;
		font-weight: normal;
		text-align: left;
		white-space: nowrap;
		line-height: 40rpx;
	}
</style>